Kwik.Page.include("Kwik.Ui.Controls.Window.js");

/**
* Manager utility supplies activation modes for windows
* @singleton
* @requires Kwik.Ui.Controls.Window
* @created 3:39 PM 3/22/2009
* @modified 3:39 PM 3/22/2009
*/
Kwik.Ui.Controls.WindowManager =
{
	/** Current active window on the document @type Kwik.Ui.Controls.Window */
	activeWindow: null,
	/** Activate the supplied window */
	activate: function(win)
	{
		if(win === Kwik.Ui.Controls.WindowManager.activeWindow){return;}
		Kwik.Page.log.write("Kwik.Ui.Controls.WindowManager.activate: New active window, ptr:" + win.ptr.toString());

		if(Kwik.Ui.Controls.WindowManager.activeWindow!=null)
			Kwik.Ui.Controls.WindowManager.activeWindow._deactivate();

		Kwik.Ui.Controls.WindowManager.activeWindow = win;
	}
};